import java.util.Stack;

public class MyQueueUseStack {
    public Stack<Integer> stack1;
    public Stack<Integer> stack2;
    public MyQueueUseStack() {
        stack1 = new Stack<>();
        stack2 = new Stack<>();
    }

    public void push(int x) {
        stack1.push(x);
    }

    public int pop() {
        if(empty()) {
            return -1;
        }
        if (!stack2.empty()) {
            return stack2.pop();
        } else {
            while (!stack1.empty()) {
                int tmp = stack1.pop();
                stack2.push(tmp);
            }
        }
        return stack2.pop();
    }

    public boolean empty()



    public static void main(String[] args) {

    }
}